<?php


namespace app\user\model;


use think\Model;

class OrderModel extends Model
{
    protected $name = 'orders';

    public function getImageAttr($imager)
    {
        return request()->domain().$imager;
    }

    public function getSwitchAttr($val)
    {
        if ($val == 0) {
            $val = '待付款';
        }elseif ($val == 1){
            $val = '待收货';
        }elseif ($val == 2){
            $val = '租赁中';
        }elseif ($val == 3){
            $val = '已到期';
        }elseif ($val == 4){
            $val = '已归还';
        }
        return $val;

    }

    public function getRepaSwitchAttr($val)
    {
        if ($val == 0) {
            $val = '未报修';
        }elseif ($val == 1){
            $val = '保修中';
        }elseif ($val == 2){
            $val = '已完成';
        }
        return $val;

    }

    public function getPayTypeAttr($val)
    {
        if ($val == 0) {
            $val = '未支付';
        }elseif ($val == 1){
            $val = '微信支付';
        }elseif ($val == 2){
            $val = '支付宝支付';
        }elseif ($val == 3){
            $val = '银行卡支付';
        }
        return $val;

    }
}